#ifndef DAYWIDGET_H
#define DAYWIDGET_H

#include <QWidget>
#include <QEvent>
#include <QPaintEvent>
#include <QPainter>
#include <QStyleOption>

namespace Ui {
class DayWidget;
}

class DayWidget : public QWidget
{
    Q_OBJECT

public:
    explicit DayWidget(QWidget *parent = nullptr);
    ~DayWidget();
    Q_PROPERTY(bool Selected READ getSelected WRITE setSelected) //给脚本和元对象系统用的,因为用到qml进行开发，
                                                                 //第一个是属性，//另两个是get方法和set方法
    Q_PROPERTY(int  MonType READ  getMonType WRITE setMonType)


private:
    Ui::DayWidget *ui;
private:
    bool    bSelected;
    int     nIndex;
    int     nMonType;

signals:
    void    signalMouseDoubleClick(bool, int, int);

protected:
    bool    eventFilter(QObject *pObj, QEvent *pEvent);
    void    paintEvent(QPaintEvent *event);

public:
    void    setDay(int nDay);
    int     getDay();
    void    setHint(const QString& strHint);
    QString getHint();
    void    setSelected(bool selected);
    bool    getSelected() const;
    void    setIndex(int index);
    int     getIndex();
    void    setMonType(int monType);
    int     getMonType() const;
};

#endif // DAYWIDGET_H
